package org.jeecg.modules.basic.payment.unitprice.service.impl;


import org.jeecg.modules.basic.payment.unitprice.entity.LwgyUnitPrice;
import org.jeecg.modules.basic.payment.unitprice.mapper.LwgyStepPriceMapper;
import org.jeecg.modules.basic.payment.unitprice.mapper.LwgyUnitPriceMapper;
import org.jeecg.modules.basic.payment.unitprice.service.ILwgyUnitPriceService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 单价设置
 * @Author: jeecg-boot
 * @Date:   2024-01-28
 * @Version: V1.0
 */
@Service
public class LwgyUnitPriceServiceImpl extends ServiceImpl<LwgyUnitPriceMapper, LwgyUnitPrice> implements ILwgyUnitPriceService {

	@Autowired
	private LwgyUnitPriceMapper lwgyUnitPriceMapper;
	@Autowired
	private LwgyStepPriceMapper lwgyStepPriceMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		lwgyStepPriceMapper.deleteByMainId(id);
		lwgyUnitPriceMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			lwgyStepPriceMapper.deleteByMainId(id.toString());
			lwgyUnitPriceMapper.deleteById(id);
		}
	}
	
}
